Skip to content

Add a family of 14 new string processing nodes#4010

Merged
Keavon merged 23 commits intomasterfrom
string-nodes
Apr 24, 2026
Merged

Add a family of 14 new string processing nodes#4010
Keavon merged 23 commits intomasterfrom
string-nodes

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented Apr 5, 2026

Category - Text

  • Format Number: Formats a number as a string with control over decimal places, separators, fixed decimals, and thousands grouping.
  • String to Number: Parses a string into a number, with a configurable fallback value.
  • String Truncate: Clips a string to a max character length, optionally appending a suffix (e.g. ) on truncation.
  • String Trim: Removes leading and/or trailing whitespace, independently toggleable for start and end.
  • String Escape: Converts between literal escape sequences (\n, \t, etc.) and their actual control characters, in either direction.
  • String Reverse: Reverses the character sequence of a string.
  • String Repeat: Repeats a string N times, with an optional separator and a "Separator Escaping" option.
  • String Pad: Pads a string to a target length with a fill substring, with start/end targeting and an "Up To" parameter.
  • String Contains: Checks if a string contains a substring, optionally anchored to the start and/or end.
  • String Find Index: Returns the index of the first (or last) occurrence of a substring, or -1 if not found.
  • String Occurrences: Counts occurrences of a substring within a string.
  • String Join: Joins a list of strings with a separator; the inverse of String Split.

Category - Context

  • Map String: Iterates over a list of strings, evaluating a mapped node operation for each one (loop construct).
  • Read String: Reads the current string from inside a Map String loop.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive set of string manipulation nodes to the node graph, including functionality for capitalization, joining, padding, repeating, and searching. It also updates the UI to support these nodes, specifically adding a property editor for string capitalization with joiner presets, and refines the string_slice node to use integer types. Review feedback pointed out a bug in the unescaping logic for string separators where the order of replacements could lead to incorrect results, and suggested improvements to the capitalization behavior when word-splitting is disabled to ensure consistency and standard formatting.

Comment thread node-graph/nodes/gcore/src/logic.rs Outdated
Comment thread node-graph/nodes/gcore/src/logic.rs Outdated
Comment thread node-graph/nodes/gcore/src/logic.rs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 8 files

Confidence score: 3/5

  • There is concrete user-impact risk in node-graph/nodes/gcore/src/logic.rs: Unicode case conversion keeps only the first character from to_uppercase()/to_lowercase(), which can produce incorrect text for some characters/locales.
  • editor/src/messages/portfolio/document/node_graph/node_properties.rs has a UI logic inconsistency where UseJoiner can be hidden when JoinerInput is exposed, and node-graph/nodes/gcore/src/logic.rs also has a use_joiner behavior mismatch for LowerCase/UpperCase; together these are moderate regressions but likely localized.
  • The PR title format issue in node-graph/nodes/gcore/Cargo.toml is process-related rather than runtime functionality, so it should be fixed but does not by itself indicate breakage.
  • Pay close attention to node-graph/nodes/gcore/src/logic.rs and editor/src/messages/portfolio/document/node_graph/node_properties.rs - text transformation correctness and joiner control visibility/behavior need validation before merge.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/nodes/gcore/Cargo.toml">

<violation number="1" location="node-graph/nodes/gcore/Cargo.toml:31">
P1: Custom agent: **PR title enforcement**

PR title does not follow the required "New nodes" dedicated format. Rename it to `New nodes: 'Name1', 'Name2', and 'Name3'` (with actual node names in single quotes).</violation>
</file>

<file name="editor/src/messages/portfolio/document/node_graph/node_properties.rs">

<violation number="1" location="editor/src/messages/portfolio/document/node_graph/node_properties.rs:1628">
P2: `UseJoiner` control is conditionally hidden when `JoinerInput` is exposed, because both controls are gated on `joiner_value` being non-exposed.</violation>
</file>

<file name="node-graph/nodes/gcore/src/logic.rs">

<violation number="1" location="node-graph/nodes/gcore/src/logic.rs:222">
P2: `use_joiner` is documented as applying to capitalization conversion, but `LowerCase`/`UpperCase` ignore `joiner` when it is enabled.

(Based on your team's feedback about aligning behavior with comments and TODO expectations.) [FEEDBACK_USED]</violation>

<violation number="2" location="node-graph/nodes/gcore/src/logic.rs:234">
P2: Unicode case conversion is lossy here because only the first character of `to_uppercase()`/`to_lowercase()` is kept.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread node-graph/nodes/gcore/Cargo.toml
Comment thread node-graph/nodes/gcore/src/logic.rs Outdated
Comment thread node-graph/nodes/gcore/src/logic.rs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 16 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/nodes/text/src/lib.rs">

<violation number="1" location="node-graph/nodes/text/src/lib.rs:156">
P3: `first.clone()` is unnecessary — `first` is already an owned `String` and `+` consumes it, reusing its buffer. The clone wastes an allocation.</violation>

<violation number="2" location="node-graph/nodes/text/src/lib.rs:799">
P2: `regex_find` has an empty category `""` while every other regex node uses `"Text: Regex"`. This will cause the node to be miscategorized in the UI.</violation>
</file>

<file name="node-graph/nodes/math/Cargo.toml">

<violation number="1" location="node-graph/nodes/math/Cargo.toml:12">
P1: Custom agent: **PR title enforcement**

PR title violates the PR title rule’s "Special Commit Types → New nodes" format: new-node PRs must be titled as `New node: 'Node Name'` or `New nodes: 'Name1', 'Name2', and 'Name3'`, not `Add new string processing nodes`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread node-graph/nodes/math/Cargo.toml
Comment thread node-graph/nodes/text/src/lib.rs Outdated
Comment thread node-graph/nodes/text/src/lib.rs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="node-graph/nodes/text/src/lib.rs">

<violation number="1" location="node-graph/nodes/text/src/lib.rs:296">
P1: When the number is integer-valued (e.g. `0.0`, `1.0`), meaningful precision is 0, so the formatted string has no decimal point. The `None` early-return ignores `extra_zeros` and `fixed_decimals`, producing `"0"` instead of `"0.00"`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread node-graph/nodes/text/src/lib.rs
@Keavon
Copy link
Copy Markdown
Member Author

Keavon commented Apr 24, 2026

@cubic-dev-ai

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 24, 2026

@cubic-dev-ai

@Keavon I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Confidence score: 3/5

  • There are concrete user-facing correctness risks: in node-graph/nodes/text/src/lib.rs, a long suffix can make output exceed the documented max length when keep is floored to 0.
  • In editor/src/messages/portfolio/document/node_graph/node_properties.rs, UI disabling tied only to use_thousands can incorrectly disable controls when values are graph-driven, which may confuse users and hide valid edits.
  • The issues are mid-severity (5/10) with strong confidence, so this is mergeable with caution but carries some regression risk in text formatting and node property UX.
  • Pay close attention to node-graph/nodes/text/src/lib.rs and editor/src/messages/portfolio/document/node_graph/node_properties.rs - length-limit enforcement and dependent-control enable/disable behavior.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/portfolio/document/node_graph/node_properties.rs">

<violation number="1" location="editor/src/messages/portfolio/document/node_graph/node_properties.rs:1647">
P2: Dependent UI disabling is based on `use_thousands` without handling exposed inputs, so controls can be incorrectly disabled when the value is driven from the graph.</violation>
</file>

<file name="node-graph/nodes/text/src/lib.rs">

<violation number="1" location="node-graph/nodes/text/src/lib.rs:211">
P2: When `suffix` is longer than `length`, the output exceeds the documented maximum. `saturating_sub` silently floors `keep` to 0, but the full suffix is still appended unchecked. Either clamp the suffix to `max_length` graphemes, or skip the suffix entirely when it doesn't fit.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread node-graph/nodes/text/src/lib.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant